package com.pym.bs.service.Impl;

import com.pym.bs.dao.DemosMapper;
import com.pym.bs.enums.ResultEnum;
import com.pym.bs.service.SelectOptionService;
import com.pym.bs.utils.ResultVOUtils;
import com.pym.bs.vo.ResultVO;
import com.pym.bs.vo.SelectVO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class SelectOptionServiceImpl implements SelectOptionService {

    @Resource
    private DemosMapper demosMapper;

    @Override
    public ResultVO<SelectVO> selectData() {
        try {
            List<SelectVO> list = demosMapper.selectData();
            return ResultVOUtils.success(list);
        } catch (Exception e){
            e.printStackTrace();
            return ResultVOUtils.error(ResultEnum.INTERNAL_SERVER_ERROR);
        }
    }
}
